package lab02.Test06;

import java.util.Scanner;

/**
 * Created by 星月 on 2017/10/15.
 */
public class Circle {
    //属性：半径、周长和面积
    double radius;
    double perimter;
    double area;
    //行为：返回周长、面积
    public double getPerimter() {
        double perimter=2*3.14*radius;
        System.out.println("圆的周长："+perimter);
        return perimter;
    }
    public double getArea() {
        double area=3.14*radius*radius;
        System.out.println("圆的面积："+area);
        return area;
    }
    //构造函数
    //main函数
    public static void main(String[] args) {
        Scanner i=new Scanner(System.in);
        double radius=i.nextDouble();
        Circle n=null;
        n=new Circle();
        n.radius=radius;
        n.getPerimter();
        n.getArea();
    }
}
